<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>QCNSim: QcnSim/Link.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">QCNSim
   </div>
   <div id="projectbrief">Simulator for Quake-Catcher Network</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d21be12960473ba5c51e5f9beea3525e.html">QcnSim</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Link.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_link_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_link_8h.html">Link.h</a>&quot;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;</div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="class_link.html#aaaf840f77f9ad3f577a6746fd30c8577">   34</a></span>&#160;<a class="code" href="class_link.html#aaaf840f77f9ad3f577a6746fd30c8577">Link::Link</a>(std::shared_ptr&lt;Node&gt; nodeA, std::shared_ptr&lt;Node&gt; nodeB, <span class="keywordtype">double</span> bandwidth, <span class="keywordtype">double</span> propagationDelay, <a class="code" href="class_simulator_globals.html">SimulatorGlobals</a> &amp;<a class="code" href="class_facility.html#a04cb8b8f3d633cfcf6ba1603f5dfe7ad">simulatorGlobals</a>,</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;        <a class="code" href="class_scheduler.html">Scheduler</a> &amp;<a class="code" href="class_facility.html#a36b590795f3752bd89a4a3ec5fa1307d">scheduler</a>, <span class="keyword">const</span> std::string &amp;<a class="code" href="class_facility.html#a5967500c415fbf6b3bf420b58e645a6e">name</a>) : nodeA(nodeA), nodeB(nodeB), bandwidth(bandwidth),</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;        propagationDelay(propagationDelay), simulatorGlobals(simulatorGlobals), scheduler(scheduler), name(name),</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;        transmissionServer(<a class="code" href="class_facility.html">Facility</a>(<span class="stringliteral">&quot;Transmission Server 1-2&quot;</span>, simulatorGlobals, scheduler)), droppedPdusCountMedium(0) { <span class="comment">// Creates one transmission server (Facility with one server).</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;}</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="class_link.html#a4d8007c08641925ab31385d28cb0f39e">   43</a></span>&#160;<a class="code" href="class_link.html#a4d8007c08641925ab31385d28cb0f39e">Link::~Link</a>() {</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;}</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="comment">// * @brief Return reference to nodeA.</span></div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="comment">// *</span></div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="comment">// * @return Reference to Node at nodeA.</span></div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="comment">// */</span></div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="comment">//Node &amp;Link::getnodeA() const {</span></div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="comment">//  return nodeA;</span></div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="comment">//}</span></div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="comment"></span><span class="comment">// * @brief Return reference to nodeA.</span></div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="comment">// *</span></div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="comment">// * @return Reference to Node at nodeA.</span></div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="comment">// */</span></div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="comment">//Node &amp;Link::getnodeB() const {</span></div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="comment">//  return nodeB;</span></div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="comment">//}</span></div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="class_link.html#a2cafc5931128c3a03ac50fa283e9c18f">   69</a></span>&#160;<span class="keywordtype">double</span> <a class="code" href="class_link.html#a2cafc5931128c3a03ac50fa283e9c18f">Link::getBandwidth</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#aff4506be6c9b62b335e3a389a01969ef">bandwidth</a>;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;}</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="class_link.html#ab6f3bcc6896090d2b0ab665c0fedbf17">   78</a></span>&#160;<span class="keywordtype">double</span> <a class="code" href="class_link.html#ab6f3bcc6896090d2b0ab665c0fedbf17">Link::getPropagationDelay</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#a31855f1eaf9c6562f1dc2067d475dd4d">propagationDelay</a>;</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;}</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="class_link.html#ad0d2091b3406725300be167b82216552">   87</a></span>&#160;std::string <a class="code" href="class_link.html#ad0d2091b3406725300be167b82216552">Link::getName</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#a3175152212d21764b83996c540617838">name</a>;</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;}</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;</div>
<div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="class_link.html#a3f1d8f13ecc78be10812fa1d78670339">   96</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_link.html#a3f1d8f13ecc78be10812fa1d78670339">Link::isUp</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#a648c145304ac37af293458ea11f674c3">isUp</a>();</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;}</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;</div>
<div class="line"><a name="l00106"></a><span class="lineno"><a class="line" href="class_link.html#a57170d6e8669a32107794b0a2cc98890">  106</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_link.html#a57170d6e8669a32107794b0a2cc98890">Link::setUp</a>() {</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#a9cf2c05d0966a731a8a9d9157a13df5e">setUp</a>();</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;}</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div>
<div class="line"><a name="l00117"></a><span class="lineno"><a class="line" href="class_link.html#afe69b641a7b52cdc830307dfcd9e8af3">  117</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_link.html#afe69b641a7b52cdc830307dfcd9e8af3">Link::setDown</a>() {</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#a0f7671f75b0309c520692c2a210e734e">setDown</a>() + <a class="code" href="class_link.html#aa2abd35db916156b8204655f89df6e3a">purgeQueue</a>();</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;}</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;</div>
<div class="line"><a name="l00126"></a><span class="lineno"><a class="line" href="class_link.html#abb8a206db623b733b98bb5866335b19f">  126</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_link.html#abb8a206db623b733b98bb5866335b19f">Link::getInTransitQueueSize</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#a53ed79d4f4d927e120d0cbfa00158089">inTransitQueue</a>.size();</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;}</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;</div>
<div class="line"><a name="l00157"></a><span class="lineno"><a class="line" href="class_link.html#aeba26f0ab710ff765646e669a60ac682">  157</a></span>&#160;<a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83af">LinkReturnType</a> <a class="code" href="class_link.html#aeba26f0ab710ff765646e669a60ac682">Link::transmitPDU</a>(<a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6fa">EventType</a> transmitEventType, <a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6fa">EventType</a> endTransmitEventType, std::shared_ptr&lt;const ProtocolDataUnit&gt; pdu) {</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    <span class="comment">// Consistency check. If nodes in PDU&#39;s previous and next fields are not connected by this node, then refuse transmission and return error state.</span></div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    <span class="keywordflow">if</span> (pdu-&gt;previous != <a class="code" href="class_link.html#afc5d6ab142420b803c1f9802ad0199f5">nodeA</a> || pdu-&gt;next != <a class="code" href="class_link.html#af7a426a53a41d26351c85cb2cea50d60">nodeB</a>) {</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa1540ac8eab2f22bb0c7e66c69ff50dc3">LinkReturnType::ERROR_LINK_DOES_NOT_CONNECT_NODES</a>;</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    }</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    <span class="keywordtype">double</span> transmissionTime = pdu-&gt;getPduSize() * 8.0 / <a class="code" href="class_link.html#aff4506be6c9b62b335e3a389a01969ef">bandwidth</a>; <span class="comment">// Converts PDU size to bits and calculates transmission time based on bandwidth.</span></div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    <span class="comment">// Request service for PDU at Facility (transmission server).</span></div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    <a class="code" href="_facility_return_type_8h.html#a4ebe26bb7c3ad3b1926de74522fcc72c">FacilityReturnType</a> serviceRequestResult = <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#ad8579e469df0909ad36ee6b0719a2173">request</a>(pdu, transmitEventType);</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    <span class="comment">// Test outcomes.</span></div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    <span class="keywordflow">if</span> (serviceRequestResult == <a class="code" href="_facility_return_type_8h.html#a4ebe26bb7c3ad3b1926de74522fcc72ca748fbb782cdc23671570937bca42c031">FacilityReturnType::TOKEN_PUT_IN_SERVICE</a>) {</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;        <a class="code" href="class_link.html#ad60d0e445f4593579b62a3c2ecd1fa75">scheduler</a>.<a class="code" href="class_scheduler.html#ae84f19f548d606f50fba69d00fe691b1">schedule</a>(<a class="code" href="class_event.html">Event</a>(transmissionTime, endTransmitEventType, pdu)); <span class="comment">// Successful; schedule next event to release/propagate.</span></div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afacd81b4be909430d796a08b373c59d714">LinkReturnType::PDU_IN_TRANSMISSION_NEXT_EVENT_SCHEDULED</a>;</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (serviceRequestResult == <a class="code" href="_facility_return_type_8h.html#a4ebe26bb7c3ad3b1926de74522fcc72ca29752595827eef50aabead37d4eb7761">FacilityReturnType::FACILITY_BUSY_QUEUE_FULL_TOKEN_DROPPED</a>) { <span class="comment">// Facility queue full, PDU was dropped; update statistics.</span></div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;<span class="comment"></span>        <span class="keywordflow">return</span> <a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa9b52d9f68401bbcbaba5dc65b99898d1">LinkReturnType::LINK_BUSY_QUEUE_FULL_PDU_DROPPED</a>;</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (serviceRequestResult == <a class="code" href="_facility_return_type_8h.html#a4ebe26bb7c3ad3b1926de74522fcc72caeccec682378d2895857cde4b04dd58e1">FacilityReturnType::FACILITY_DOWN_TOKEN_DROPPED</a>) { <span class="comment">// Facility down (thus link is also down); PDU dropped, update stats of Node?</span></div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;<span class="comment"></span>        <span class="keywordflow">return</span> <a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa0bec40bfb1c3fa48c0a7b3b5817508f4">LinkReturnType::LINK_DOWN_PDU_DROPPED</a>;</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (serviceRequestResult == <a class="code" href="_facility_return_type_8h.html#a4ebe26bb7c3ad3b1926de74522fcc72ca9eabb9b43310855334df811fd9c79748">FacilityReturnType::FACILITY_BUSY_TOKEN_ENQUEUED</a>) { <span class="comment">// Facility busy, token enqueued. Nothing else to do.</span></div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa22ccb03889f70235c3d563f564d204c6">LinkReturnType::LINK_BUSY_PDU_ENQUEUED</a>;</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa3e860a081575fc82cc7b6ed2ca602947">LinkReturnType::NOT_IMPLEMENTED</a>; <span class="comment">// Something weird happened...</span></div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    }</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;}</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;</div>
<div class="line"><a name="l00198"></a><span class="lineno"><a class="line" href="class_link.html#a94f1e68ad68a9ebd10fae43a531347d4">  198</a></span>&#160;<a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83af">LinkReturnType</a> <a class="code" href="class_link.html#a94f1e68ad68a9ebd10fae43a531347d4">Link::propagatePDU</a>(<a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6fa">EventType</a> nextEvent, std::shared_ptr&lt;const ProtocolDataUnit&gt; pdu) {</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;    <span class="comment">// Release PDU from transmission Facility.</span></div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;    <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#af3c20895dff840f8db94350070360e70">release</a>(pdu);</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;    <span class="comment">// If link is down, discard PDU, update statistics.</span></div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="class_link.html#a3f1d8f13ecc78be10812fa1d78670339">isUp</a>()) {</div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;        ++<a class="code" href="class_link.html#a71c43c39d94c9b8b95d1810b5c7d17ac">droppedPdusCountMedium</a>;</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa0bec40bfb1c3fa48c0a7b3b5817508f4">LinkReturnType::LINK_DOWN_PDU_DROPPED</a>;</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;    }</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;    <span class="comment">// Otherwise, insert PDU into inTransitQueue and schedule next arrival event.</span></div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;    <a class="code" href="class_link.html#a53ed79d4f4d927e120d0cbfa00158089">inTransitQueue</a>.push_back(pdu); <span class="comment">// Insert into queue.</span></div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;    <a class="code" href="class_link.html#ad60d0e445f4593579b62a3c2ecd1fa75">scheduler</a>.<a class="code" href="class_scheduler.html#ae84f19f548d606f50fba69d00fe691b1">schedule</a>(<a class="code" href="class_event.html">Event</a>(<a class="code" href="class_link.html#a31855f1eaf9c6562f1dc2067d475dd4d">propagationDelay</a>, nextEvent, pdu));</div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa546235efbb1655a5182b7eaf007ac0cc">LinkReturnType::PDU_IN_TRANSIT_NEXT_EVENT_SCHEDULED</a>;</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;}</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;</div>
<div class="line"><a name="l00220"></a><span class="lineno"><a class="line" href="class_link.html#aa9f5b6b14f9f191421c7e131ccb288ea">  220</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_link.html#aa9f5b6b14f9f191421c7e131ccb288ea">Link::isTransmissionServerBusy</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#a51a7f1911c56425bd1f341b3c2b005e0">isBusy</a>();</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;}</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;</div>
<div class="line"><a name="l00233"></a><span class="lineno"><a class="line" href="class_link.html#ab122159183081cdeb5f7b8947f62b9a7">  233</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_link.html#ab122159183081cdeb5f7b8947f62b9a7">Link::endPropagation</a>(std::shared_ptr&lt;ProtocolDataUnit&gt; pdu) {</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;    <a class="code" href="class_link.html#a53ed79d4f4d927e120d0cbfa00158089">inTransitQueue</a>.remove(pdu); <span class="comment">// Removes the PDU (it should be at head of queue). If not found, does nothing.</span></div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;}</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;</div>
<div class="line"><a name="l00242"></a><span class="lineno"><a class="line" href="class_link.html#a297af435322be39d8562091688c460a7">  242</a></span>&#160;std::list&lt;FacilityQueueElement&gt;::size_type <a class="code" href="class_link.html#a297af435322be39d8562091688c460a7">Link::getTransmissionQueueSize</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#a61f5bb8a3af86066d29dd2eeca3cdd84">getQueueSize</a>();</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;}</div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;</div>
<div class="line"><a name="l00251"></a><span class="lineno"><a class="line" href="class_link.html#a3ae26f20287944d54c2db9d12b56f28d">  251</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_link.html#a3ae26f20287944d54c2db9d12b56f28d">Link::getMaxRecordedTransmissionQueueSize</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#a6ed30291bca3882e011216265f7d7462">getMaxRecordedQueueSize</a>();</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;}</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;</div>
<div class="line"><a name="l00260"></a><span class="lineno"><a class="line" href="class_link.html#ab93be277b905f1bd1746d649ebb4461d">  260</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_link.html#ab93be277b905f1bd1746d649ebb4461d">Link::getTransmissionQueueSizeLimit</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#ababbaa909332f3c55699721dc087f0c3">getQueueSizeLimit</a>();</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;}</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;</div>
<div class="line"><a name="l00272"></a><span class="lineno"><a class="line" href="class_link.html#af64db4e49ef26c305b301db2ae318244">  272</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_link.html#af64db4e49ef26c305b301db2ae318244">Link::setTransmissionQueueSizeLimit</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> limit) {</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;    <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#a4d8bbec743dae89da983619eedb2e129">setQueueSizeLimit</a>(limit);</div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;}</div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;</div>
<div class="line"><a name="l00281"></a><span class="lineno"><a class="line" href="class_link.html#af485c0065bf1fdc5c296b45f6ef96fd3">  281</a></span>&#160;std::shared_ptr&lt;Node&gt; <a class="code" href="class_link.html#af485c0065bf1fdc5c296b45f6ef96fd3">Link::getNodeA</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#afc5d6ab142420b803c1f9802ad0199f5">nodeA</a>;</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;}</div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;</div>
<div class="line"><a name="l00290"></a><span class="lineno"><a class="line" href="class_link.html#adb8020ddc851ceb0bf5dba01182d688c">  290</a></span>&#160;std::shared_ptr&lt;Node&gt; <a class="code" href="class_link.html#adb8020ddc851ceb0bf5dba01182d688c">Link::getNodeB</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#af7a426a53a41d26351c85cb2cea50d60">nodeB</a>;</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;}</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;</div>
<div class="line"><a name="l00302"></a><span class="lineno"><a class="line" href="class_link.html#a0866e5df549e6c3d83c0247d098d4ab0">  302</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_link.html#a0866e5df549e6c3d83c0247d098d4ab0">Link::getDroppedPdusCountTransmissionServer</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#ac1724d4f29211f7008a14c767f9dc359">getDroppedTokensCount</a>();</div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;}</div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;</div>
<div class="line"><a name="l00314"></a><span class="lineno"><a class="line" href="class_link.html#af5d1051d4f63ff9018fd4d6f5848dcf1">  314</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_link.html#af5d1051d4f63ff9018fd4d6f5848dcf1">Link::getDroppedPdusCountMedium</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#a71c43c39d94c9b8b95d1810b5c7d17ac">droppedPdusCountMedium</a>;</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;}</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;</div>
<div class="line"><a name="l00326"></a><span class="lineno"><a class="line" href="class_link.html#a194c6afd1182f7543ebd50f859b86123">  326</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_link.html#a194c6afd1182f7543ebd50f859b86123">Link::getDroppedPdusCountWholeLink</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#ac1724d4f29211f7008a14c767f9dc359">getDroppedTokensCount</a>() + <a class="code" href="class_link.html#a71c43c39d94c9b8b95d1810b5c7d17ac">droppedPdusCountMedium</a>;</div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;}</div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;</div>
<div class="line"><a name="l00335"></a><span class="lineno"><a class="line" href="class_link.html#aa2abd35db916156b8204655f89df6e3a">  335</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_link.html#aa2abd35db916156b8204655f89df6e3a">Link::purgeQueue</a>() {</div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;    <span class="comment">// Drop each PDU in inTransitQueue and update statistics.</span></div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> droppedPdusHere = <a class="code" href="class_link.html#a53ed79d4f4d927e120d0cbfa00158089">inTransitQueue</a>.size(); <span class="comment">// PDUs dropped from link medium, in transit queue.</span></div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;    <span class="keywordflow">while</span> (<a class="code" href="class_link.html#a53ed79d4f4d927e120d0cbfa00158089">inTransitQueue</a>.size() &gt; 0) {</div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;        <a class="code" href="class_link.html#ad60d0e445f4593579b62a3c2ecd1fa75">scheduler</a>.<a class="code" href="class_scheduler.html#ac09d9f9b4147c949268fa6bc66ced974">removeEvents</a>(<a class="code" href="class_link.html#a53ed79d4f4d927e120d0cbfa00158089">inTransitQueue</a>.front()); <span class="comment">// Delete events related to first PDU.</span></div>
<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;        <a class="code" href="class_link.html#a53ed79d4f4d927e120d0cbfa00158089">inTransitQueue</a>.pop_front(); <span class="comment">// Remove first PDU.</span></div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;    }</div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;    <a class="code" href="class_link.html#a71c43c39d94c9b8b95d1810b5c7d17ac">droppedPdusCountMedium</a> += droppedPdusHere; <span class="comment">// Update member counter for dropped PDUs in link medium.</span></div>
<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;    <span class="keywordflow">return</span> droppedPdusHere;</div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;}</div>
<div class="ttc" id="class_link_html_aa9f5b6b14f9f191421c7e131ccb288ea"><div class="ttname"><a href="class_link.html#aa9f5b6b14f9f191421c7e131ccb288ea">Link::isTransmissionServerBusy</a></div><div class="ttdeci">virtual bool isTransmissionServerBusy() const </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00220">Link.cpp:220</a></div></div>
<div class="ttc" id="class_link_html_ab122159183081cdeb5f7b8947f62b9a7"><div class="ttname"><a href="class_link.html#ab122159183081cdeb5f7b8947f62b9a7">Link::endPropagation</a></div><div class="ttdeci">virtual void endPropagation(std::shared_ptr&lt; ProtocolDataUnit &gt; pdu)</div><div class="ttdoc">PDU has successfully propagated through the link; end propagation. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00233">Link.cpp:233</a></div></div>
<div class="ttc" id="class_link_html_aaaf840f77f9ad3f577a6746fd30c8577"><div class="ttname"><a href="class_link.html#aaaf840f77f9ad3f577a6746fd30c8577">Link::Link</a></div><div class="ttdeci">Link(std::shared_ptr&lt; Node &gt; nodeA, std::shared_ptr&lt; Node &gt; nodeB, double bandwidth, double propagationDelay, SimulatorGlobals &amp;simulatorGlobals, Scheduler &amp;scheduler, const std::string &amp;name=&quot;&quot;)</div><div class="ttdoc">Default constructor. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00034">Link.cpp:34</a></div></div>
<div class="ttc" id="_facility_return_type_8h_html_a4ebe26bb7c3ad3b1926de74522fcc72caeccec682378d2895857cde4b04dd58e1"><div class="ttname"><a href="_facility_return_type_8h.html#a4ebe26bb7c3ad3b1926de74522fcc72caeccec682378d2895857cde4b04dd58e1">FacilityReturnType::FACILITY_DOWN_TOKEN_DROPPED</a></div><div class="ttdoc">Facility is down. Token was dropped (or enqueued, depending on the implementation of function Facilit...</div></div>
<div class="ttc" id="_link_return_type_8h_html_a554ed4dd9752dfafac386b42493b83af"><div class="ttname"><a href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83af">LinkReturnType</a></div><div class="ttdeci">LinkReturnType</div><div class="ttdoc">Link Return Type enum class. </div><div class="ttdef"><b>Definition:</b> <a href="_link_return_type_8h_source.html#l00028">LinkReturnType.h:28</a></div></div>
<div class="ttc" id="class_link_html_aeba26f0ab710ff765646e669a60ac682"><div class="ttname"><a href="class_link.html#aeba26f0ab710ff765646e669a60ac682">Link::transmitPDU</a></div><div class="ttdeci">virtual LinkReturnType transmitPDU(EventType transmitEventType, EventType endTransmitEventType, std::shared_ptr&lt; const ProtocolDataUnit &gt; pdu)</div><div class="ttdoc">Requests transmission a PDU to (or through) the link. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00157">Link.cpp:157</a></div></div>
<div class="ttc" id="_event_type_8h_html_a2628ea8d12e8b2563c32f05dc7fff6fa"><div class="ttname"><a href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6fa">EventType</a></div><div class="ttdeci">EventType</div><div class="ttdoc">EventType enum class. </div><div class="ttdef"><b>Definition:</b> <a href="_event_type_8h_source.html#l00029">EventType.h:29</a></div></div>
<div class="ttc" id="class_link_html_af5d1051d4f63ff9018fd4d6f5848dcf1"><div class="ttname"><a href="class_link.html#af5d1051d4f63ff9018fd4d6f5848dcf1">Link::getDroppedPdusCountMedium</a></div><div class="ttdeci">virtual unsigned int getDroppedPdusCountMedium() const </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00314">Link.cpp:314</a></div></div>
<div class="ttc" id="class_link_html_a2cafc5931128c3a03ac50fa283e9c18f"><div class="ttname"><a href="class_link.html#a2cafc5931128c3a03ac50fa283e9c18f">Link::getBandwidth</a></div><div class="ttdeci">virtual double getBandwidth() const </div><div class="ttdoc">Return reference to nodeA. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00069">Link.cpp:69</a></div></div>
<div class="ttc" id="class_scheduler_html"><div class="ttname"><a href="class_scheduler.html">Scheduler</a></div><div class="ttdoc">Scheduler class. </div><div class="ttdef"><b>Definition:</b> <a href="_scheduler_8h_source.html#l00058">Scheduler.h:58</a></div></div>
<div class="ttc" id="class_link_html_ad0d2091b3406725300be167b82216552"><div class="ttname"><a href="class_link.html#ad0d2091b3406725300be167b82216552">Link::getName</a></div><div class="ttdeci">virtual std::string getName() const </div><div class="ttdoc">Return name of link. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00087">Link.cpp:87</a></div></div>
<div class="ttc" id="_link_return_type_8h_html_a554ed4dd9752dfafac386b42493b83afa9b52d9f68401bbcbaba5dc65b99898d1"><div class="ttname"><a href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa9b52d9f68401bbcbaba5dc65b99898d1">LinkReturnType::LINK_BUSY_QUEUE_FULL_PDU_DROPPED</a></div><div class="ttdoc">The queue is full (has reached the imposed limit); PDU for which service was requested was dropped...</div></div>
<div class="ttc" id="class_event_html"><div class="ttname"><a href="class_event.html">Event</a></div><div class="ttdoc">Event class. </div><div class="ttdef"><b>Definition:</b> <a href="_event_8h_source.html#l00035">Event.h:35</a></div></div>
<div class="ttc" id="class_link_html_af64db4e49ef26c305b301db2ae318244"><div class="ttname"><a href="class_link.html#af64db4e49ef26c305b301db2ae318244">Link::setTransmissionQueueSizeLimit</a></div><div class="ttdeci">virtual void setTransmissionQueueSizeLimit(unsigned int limit)</div><div class="ttdoc">Set transmission (Facility) queue size limit. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00272">Link.cpp:272</a></div></div>
<div class="ttc" id="class_facility_html_a61f5bb8a3af86066d29dd2eeca3cdd84"><div class="ttname"><a href="class_facility.html#a61f5bb8a3af86066d29dd2eeca3cdd84">Facility::getQueueSize</a></div><div class="ttdeci">std::list&lt; FacilityQueueElement &gt;::size_type getQueueSize() const </div><div class="ttdef"><b>Definition:</b> <a href="_facility_8cpp_source.html#l00723">Facility.cpp:723</a></div></div>
<div class="ttc" id="class_link_html_a94f1e68ad68a9ebd10fae43a531347d4"><div class="ttname"><a href="class_link.html#a94f1e68ad68a9ebd10fae43a531347d4">Link::propagatePDU</a></div><div class="ttdeci">virtual LinkReturnType propagatePDU(EventType nextEvent, std::shared_ptr&lt; const ProtocolDataUnit &gt; pdu)</div><div class="ttdoc">Ends transmission (release PDU from Facility) and propagate PDU through this link. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00198">Link.cpp:198</a></div></div>
<div class="ttc" id="class_facility_html_ac1724d4f29211f7008a14c767f9dc359"><div class="ttname"><a href="class_facility.html#ac1724d4f29211f7008a14c767f9dc359">Facility::getDroppedTokensCount</a></div><div class="ttdeci">unsigned int getDroppedTokensCount() const </div><div class="ttdef"><b>Definition:</b> <a href="_facility_8cpp_source.html#l00909">Facility.cpp:909</a></div></div>
<div class="ttc" id="class_link_html_af485c0065bf1fdc5c296b45f6ef96fd3"><div class="ttname"><a href="class_link.html#af485c0065bf1fdc5c296b45f6ef96fd3">Link::getNodeA</a></div><div class="ttdeci">virtual std::shared_ptr&lt; Node &gt; getNodeA() const </div><div class="ttdoc">Return pointer to nodeA (one side of link). </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00281">Link.cpp:281</a></div></div>
<div class="ttc" id="class_facility_html_a5967500c415fbf6b3bf420b58e645a6e"><div class="ttname"><a href="class_facility.html#a5967500c415fbf6b3bf420b58e645a6e">Facility::name</a></div><div class="ttdeci">std::string name</div><div class="ttdoc">Facility name. </div><div class="ttdef"><b>Definition:</b> <a href="_facility_8h_source.html#l00046">Facility.h:46</a></div></div>
<div class="ttc" id="class_facility_html_a51a7f1911c56425bd1f341b3c2b005e0"><div class="ttname"><a href="class_facility.html#a51a7f1911c56425bd1f341b3c2b005e0">Facility::isBusy</a></div><div class="ttdeci">bool isBusy() const </div><div class="ttdef"><b>Definition:</b> <a href="_facility_8cpp_source.html#l00626">Facility.cpp:626</a></div></div>
<div class="ttc" id="class_link_html_a194c6afd1182f7543ebd50f859b86123"><div class="ttname"><a href="class_link.html#a194c6afd1182f7543ebd50f859b86123">Link::getDroppedPdusCountWholeLink</a></div><div class="ttdeci">virtual unsigned int getDroppedPdusCountWholeLink() const </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00326">Link.cpp:326</a></div></div>
<div class="ttc" id="class_link_html_a0866e5df549e6c3d83c0247d098d4ab0"><div class="ttname"><a href="class_link.html#a0866e5df549e6c3d83c0247d098d4ab0">Link::getDroppedPdusCountTransmissionServer</a></div><div class="ttdeci">virtual unsigned int getDroppedPdusCountTransmissionServer() const </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00302">Link.cpp:302</a></div></div>
<div class="ttc" id="class_facility_html_af3c20895dff840f8db94350070360e70"><div class="ttname"><a href="class_facility.html#af3c20895dff840f8db94350070360e70">Facility::release</a></div><div class="ttdeci">FacilityReturnType release(std::shared_ptr&lt; const Token &gt; token)</div><div class="ttdef"><b>Definition:</b> <a href="_facility_8cpp_source.html#l00586">Facility.cpp:586</a></div></div>
<div class="ttc" id="class_link_html_afc5d6ab142420b803c1f9802ad0199f5"><div class="ttname"><a href="class_link.html#afc5d6ab142420b803c1f9802ad0199f5">Link::nodeA</a></div><div class="ttdeci">std::shared_ptr&lt; Node &gt; nodeA</div><div class="ttdoc">Node at one side of the link. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8h_source.html#l00066">Link.h:66</a></div></div>
<div class="ttc" id="class_link_html_a57170d6e8669a32107794b0a2cc98890"><div class="ttname"><a href="class_link.html#a57170d6e8669a32107794b0a2cc98890">Link::setUp</a></div><div class="ttdeci">virtual void setUp()</div><div class="ttdoc">Set Link up. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00106">Link.cpp:106</a></div></div>
<div class="ttc" id="_link_8h_html"><div class="ttname"><a href="_link_8h.html">Link.h</a></div></div>
<div class="ttc" id="class_facility_html_a04cb8b8f3d633cfcf6ba1603f5dfe7ad"><div class="ttname"><a href="class_facility.html#a04cb8b8f3d633cfcf6ba1603f5dfe7ad">Facility::simulatorGlobals</a></div><div class="ttdeci">SimulatorGlobals &amp; simulatorGlobals</div><div class="ttdoc">Reference to SimulatorGlobals object (typically used to fetch the current clock time). </div><div class="ttdef"><b>Definition:</b> <a href="_facility_8h_source.html#l00065">Facility.h:65</a></div></div>
<div class="ttc" id="class_link_html_afe69b641a7b52cdc830307dfcd9e8af3"><div class="ttname"><a href="class_link.html#afe69b641a7b52cdc830307dfcd9e8af3">Link::setDown</a></div><div class="ttdeci">virtual unsigned int setDown()</div><div class="ttdoc">Set Link down. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00117">Link.cpp:117</a></div></div>
<div class="ttc" id="class_scheduler_html_ac09d9f9b4147c949268fa6bc66ced974"><div class="ttname"><a href="class_scheduler.html#ac09d9f9b4147c949268fa6bc66ced974">Scheduler::removeEvents</a></div><div class="ttdeci">unsigned int removeEvents(std::shared_ptr&lt; const Entity &gt; entity)</div><div class="ttdef"><b>Definition:</b> <a href="_scheduler_8cpp_source.html#l00118">Scheduler.cpp:118</a></div></div>
<div class="ttc" id="class_link_html_a53ed79d4f4d927e120d0cbfa00158089"><div class="ttname"><a href="class_link.html#a53ed79d4f4d927e120d0cbfa00158089">Link::inTransitQueue</a></div><div class="ttdeci">std::list&lt; std::shared_ptr&lt; const ProtocolDataUnit &gt; &gt; inTransitQueue</div><div class="ttdoc">Queue for PDUs in transit (in propagation) in this link. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8h_source.html#l00071">Link.h:71</a></div></div>
<div class="ttc" id="class_facility_html_a9cf2c05d0966a731a8a9d9157a13df5e"><div class="ttname"><a href="class_facility.html#a9cf2c05d0966a731a8a9d9157a13df5e">Facility::setUp</a></div><div class="ttdeci">void setUp()</div><div class="ttdef"><b>Definition:</b> <a href="_facility_8cpp_source.html#l00699">Facility.cpp:699</a></div></div>
<div class="ttc" id="class_link_html_abe44953f8653b44f2b914daa0bb6bcdc"><div class="ttname"><a href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">Link::transmissionServer</a></div><div class="ttdeci">Facility transmissionServer</div><div class="ttdoc">Transmission server for this Link (one-way). </div><div class="ttdef"><b>Definition:</b> <a href="_link_8h_source.html#l00074">Link.h:74</a></div></div>
<div class="ttc" id="class_scheduler_html_ae84f19f548d606f50fba69d00fe691b1"><div class="ttname"><a href="class_scheduler.html#ae84f19f548d606f50fba69d00fe691b1">Scheduler::schedule</a></div><div class="ttdeci">void schedule(const Event &amp;event)</div><div class="ttdef"><b>Definition:</b> <a href="_scheduler_8cpp_source.html#l00056">Scheduler.cpp:56</a></div></div>
<div class="ttc" id="class_link_html_a4d8007c08641925ab31385d28cb0f39e"><div class="ttname"><a href="class_link.html#a4d8007c08641925ab31385d28cb0f39e">Link::~Link</a></div><div class="ttdeci">virtual ~Link()=0</div><div class="ttdoc">Destructor. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00043">Link.cpp:43</a></div></div>
<div class="ttc" id="class_link_html_aa2abd35db916156b8204655f89df6e3a"><div class="ttname"><a href="class_link.html#aa2abd35db916156b8204655f89df6e3a">Link::purgeQueue</a></div><div class="ttdeci">unsigned int purgeQueue()</div><div class="ttdoc">Purge inTransitQueue, update statistics, return number of dropped PDUs from link medium. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00335">Link.cpp:335</a></div></div>
<div class="ttc" id="class_link_html_a3175152212d21764b83996c540617838"><div class="ttname"><a href="class_link.html#a3175152212d21764b83996c540617838">Link::name</a></div><div class="ttdeci">std::string name</div><div class="ttdoc">Name of this link. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8h_source.html#l00070">Link.h:70</a></div></div>
<div class="ttc" id="class_link_html_ab93be277b905f1bd1746d649ebb4461d"><div class="ttname"><a href="class_link.html#ab93be277b905f1bd1746d649ebb4461d">Link::getTransmissionQueueSizeLimit</a></div><div class="ttdeci">virtual unsigned int getTransmissionQueueSizeLimit() const </div><div class="ttdoc">Get transmission (Facility) queue size limit. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00260">Link.cpp:260</a></div></div>
<div class="ttc" id="_facility_return_type_8h_html_a4ebe26bb7c3ad3b1926de74522fcc72ca29752595827eef50aabead37d4eb7761"><div class="ttname"><a href="_facility_return_type_8h.html#a4ebe26bb7c3ad3b1926de74522fcc72ca29752595827eef50aabead37d4eb7761">FacilityReturnType::FACILITY_BUSY_QUEUE_FULL_TOKEN_DROPPED</a></div><div class="ttdoc">The queue is full (has reached the imposed limit); token for which service was requested was dropped...</div></div>
<div class="ttc" id="class_link_html_a3f1d8f13ecc78be10812fa1d78670339"><div class="ttname"><a href="class_link.html#a3f1d8f13ecc78be10812fa1d78670339">Link::isUp</a></div><div class="ttdeci">virtual bool isUp() const </div><div class="ttdoc">Return true if link is up; false otherwise. This status is the direct status of underlying Facility...</div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00096">Link.cpp:96</a></div></div>
<div class="ttc" id="class_link_html_ab6f3bcc6896090d2b0ab665c0fedbf17"><div class="ttname"><a href="class_link.html#ab6f3bcc6896090d2b0ab665c0fedbf17">Link::getPropagationDelay</a></div><div class="ttdeci">virtual double getPropagationDelay() const </div><div class="ttdoc">Return propagation delay or latency of link. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00078">Link.cpp:78</a></div></div>
<div class="ttc" id="class_facility_html_ad8579e469df0909ad36ee6b0719a2173"><div class="ttname"><a href="class_facility.html#ad8579e469df0909ad36ee6b0719a2173">Facility::request</a></div><div class="ttdeci">FacilityReturnType request(std::shared_ptr&lt; const Token &gt; token, EventType eventType)</div><div class="ttdef"><b>Definition:</b> <a href="_facility_8cpp_source.html#l00231">Facility.cpp:231</a></div></div>
<div class="ttc" id="_facility_return_type_8h_html_a4ebe26bb7c3ad3b1926de74522fcc72ca748fbb782cdc23671570937bca42c031"><div class="ttname"><a href="_facility_return_type_8h.html#a4ebe26bb7c3ad3b1926de74522fcc72ca748fbb782cdc23671570937bca42c031">FacilityReturnType::TOKEN_PUT_IN_SERVICE</a></div><div class="ttdoc">Token was successfuly put in service by facility. </div></div>
<div class="ttc" id="class_link_html_a71c43c39d94c9b8b95d1810b5c7d17ac"><div class="ttname"><a href="class_link.html#a71c43c39d94c9b8b95d1810b5c7d17ac">Link::droppedPdusCountMedium</a></div><div class="ttdeci">unsigned int droppedPdusCountMedium</div><div class="ttdoc">Count of dropped PDUs by this link&amp;#39;s medium. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8h_source.html#l00075">Link.h:75</a></div></div>
<div class="ttc" id="class_link_html_a297af435322be39d8562091688c460a7"><div class="ttname"><a href="class_link.html#a297af435322be39d8562091688c460a7">Link::getTransmissionQueueSize</a></div><div class="ttdeci">virtual std::list&lt; FacilityQueueElement &gt;::size_type getTransmissionQueueSize() const </div><div class="ttdoc">Get transmission (Facility) queue size. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00242">Link.cpp:242</a></div></div>
<div class="ttc" id="class_link_html_af7a426a53a41d26351c85cb2cea50d60"><div class="ttname"><a href="class_link.html#af7a426a53a41d26351c85cb2cea50d60">Link::nodeB</a></div><div class="ttdeci">std::shared_ptr&lt; Node &gt; nodeB</div><div class="ttdoc">Node at the other side of the link. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8h_source.html#l00067">Link.h:67</a></div></div>
<div class="ttc" id="class_facility_html_a6ed30291bca3882e011216265f7d7462"><div class="ttname"><a href="class_facility.html#a6ed30291bca3882e011216265f7d7462">Facility::getMaxRecordedQueueSize</a></div><div class="ttdeci">unsigned int getMaxRecordedQueueSize() const </div><div class="ttdef"><b>Definition:</b> <a href="_facility_8cpp_source.html#l00814">Facility.cpp:814</a></div></div>
<div class="ttc" id="class_facility_html"><div class="ttname"><a href="class_facility.html">Facility</a></div><div class="ttdoc">Facility class. </div><div class="ttdef"><b>Definition:</b> <a href="_facility_8h_source.html#l00044">Facility.h:44</a></div></div>
<div class="ttc" id="class_facility_html_a0f7671f75b0309c520692c2a210e734e"><div class="ttname"><a href="class_facility.html#a0f7671f75b0309c520692c2a210e734e">Facility::setDown</a></div><div class="ttdeci">unsigned int setDown()</div><div class="ttdef"><b>Definition:</b> <a href="_facility_8cpp_source.html#l00711">Facility.cpp:711</a></div></div>
<div class="ttc" id="_link_return_type_8h_html_a554ed4dd9752dfafac386b42493b83afa3e860a081575fc82cc7b6ed2ca602947"><div class="ttname"><a href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa3e860a081575fc82cc7b6ed2ca602947">LinkReturnType::NOT_IMPLEMENTED</a></div><div class="ttdoc">This function has not been implemented yet. </div></div>
<div class="ttc" id="class_link_html_adb8020ddc851ceb0bf5dba01182d688c"><div class="ttname"><a href="class_link.html#adb8020ddc851ceb0bf5dba01182d688c">Link::getNodeB</a></div><div class="ttdeci">virtual std::shared_ptr&lt; Node &gt; getNodeB() const </div><div class="ttdoc">Return pointer to nodeB (another side of link). </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00290">Link.cpp:290</a></div></div>
<div class="ttc" id="class_link_html_a31855f1eaf9c6562f1dc2067d475dd4d"><div class="ttname"><a href="class_link.html#a31855f1eaf9c6562f1dc2067d475dd4d">Link::propagationDelay</a></div><div class="ttdeci">double propagationDelay</div><div class="ttdoc">Propagation delay of this link, which is medium-dependent, typically in seconds. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8h_source.html#l00069">Link.h:69</a></div></div>
<div class="ttc" id="class_simulator_globals_html"><div class="ttname"><a href="class_simulator_globals.html">SimulatorGlobals</a></div><div class="ttdoc">Simulator-scope variables and parameters. </div><div class="ttdef"><b>Definition:</b> <a href="_simulator_globals_8h_source.html#l00044">SimulatorGlobals.h:44</a></div></div>
<div class="ttc" id="class_link_html_a3ae26f20287944d54c2db9d12b56f28d"><div class="ttname"><a href="class_link.html#a3ae26f20287944d54c2db9d12b56f28d">Link::getMaxRecordedTransmissionQueueSize</a></div><div class="ttdeci">virtual unsigned int getMaxRecordedTransmissionQueueSize() const </div><div class="ttdoc">Get transmission (Facility) max recorded queue size. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00251">Link.cpp:251</a></div></div>
<div class="ttc" id="class_link_html_ad60d0e445f4593579b62a3c2ecd1fa75"><div class="ttname"><a href="class_link.html#ad60d0e445f4593579b62a3c2ecd1fa75">Link::scheduler</a></div><div class="ttdeci">Scheduler &amp; scheduler</div><div class="ttdoc">Reference to Scheduler object. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8h_source.html#l00073">Link.h:73</a></div></div>
<div class="ttc" id="_link_return_type_8h_html_a554ed4dd9752dfafac386b42493b83afa22ccb03889f70235c3d563f564d204c6"><div class="ttname"><a href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa22ccb03889f70235c3d563f564d204c6">LinkReturnType::LINK_BUSY_PDU_ENQUEUED</a></div><div class="ttdoc">Link (transmission server) was busy; PDU was enqueued. </div></div>
<div class="ttc" id="class_facility_html_a36b590795f3752bd89a4a3ec5fa1307d"><div class="ttname"><a href="class_facility.html#a36b590795f3752bd89a4a3ec5fa1307d">Facility::scheduler</a></div><div class="ttdeci">Scheduler &amp; scheduler</div><div class="ttdoc">Reference to Scheduler object, such that dequeued tokens can be rescheduled. </div><div class="ttdef"><b>Definition:</b> <a href="_facility_8h_source.html#l00066">Facility.h:66</a></div></div>
<div class="ttc" id="_link_return_type_8h_html_a554ed4dd9752dfafac386b42493b83afa546235efbb1655a5182b7eaf007ac0cc"><div class="ttname"><a href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa546235efbb1655a5182b7eaf007ac0cc">LinkReturnType::PDU_IN_TRANSIT_NEXT_EVENT_SCHEDULED</a></div><div class="ttdoc">PDU is in transit within link medium (and within inTransitQueue). </div></div>
<div class="ttc" id="class_facility_html_a4d8bbec743dae89da983619eedb2e129"><div class="ttname"><a href="class_facility.html#a4d8bbec743dae89da983619eedb2e129">Facility::setQueueSizeLimit</a></div><div class="ttdeci">void setQueueSizeLimit(unsigned int limit)</div><div class="ttdef"><b>Definition:</b> <a href="_facility_8cpp_source.html#l00938">Facility.cpp:938</a></div></div>
<div class="ttc" id="_link_return_type_8h_html_a554ed4dd9752dfafac386b42493b83afa1540ac8eab2f22bb0c7e66c69ff50dc3"><div class="ttname"><a href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa1540ac8eab2f22bb0c7e66c69ff50dc3">LinkReturnType::ERROR_LINK_DOES_NOT_CONNECT_NODES</a></div><div class="ttdoc">The nodes within PDU&amp;#39;s previous and next fields are not connected through this link. PDU cannot travel here (inconsistency). </div></div>
<div class="ttc" id="class_link_html_aff4506be6c9b62b335e3a389a01969ef"><div class="ttname"><a href="class_link.html#aff4506be6c9b62b335e3a389a01969ef">Link::bandwidth</a></div><div class="ttdeci">double bandwidth</div><div class="ttdoc">Bandwidth of this link, typically in bits per second. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8h_source.html#l00068">Link.h:68</a></div></div>
<div class="ttc" id="class_link_html_abb8a206db623b733b98bb5866335b19f"><div class="ttname"><a href="class_link.html#abb8a206db623b733b98bb5866335b19f">Link::getInTransitQueueSize</a></div><div class="ttdeci">virtual std::list&lt; std::shared_ptr&lt; const ProtocolDataUnit &gt; &gt;::size_type getInTransitQueueSize() const </div><div class="ttdoc">Get current PDU in-transit queue size. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00126">Link.cpp:126</a></div></div>
<div class="ttc" id="class_facility_html_a648c145304ac37af293458ea11f674c3"><div class="ttname"><a href="class_facility.html#a648c145304ac37af293458ea11f674c3">Facility::isUp</a></div><div class="ttdeci">bool isUp() const </div><div class="ttdef"><b>Definition:</b> <a href="_facility_8cpp_source.html#l00683">Facility.cpp:683</a></div></div>
<div class="ttc" id="_facility_return_type_8h_html_a4ebe26bb7c3ad3b1926de74522fcc72ca9eabb9b43310855334df811fd9c79748"><div class="ttname"><a href="_facility_return_type_8h.html#a4ebe26bb7c3ad3b1926de74522fcc72ca9eabb9b43310855334df811fd9c79748">FacilityReturnType::FACILITY_BUSY_TOKEN_ENQUEUED</a></div><div class="ttdoc">Facility was busy; token was enqueued. </div></div>
<div class="ttc" id="_link_return_type_8h_html_a554ed4dd9752dfafac386b42493b83afacd81b4be909430d796a08b373c59d714"><div class="ttname"><a href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afacd81b4be909430d796a08b373c59d714">LinkReturnType::PDU_IN_TRANSMISSION_NEXT_EVENT_SCHEDULED</a></div><div class="ttdoc">PDU was successfully put into transmission (serviced) at Link. </div></div>
<div class="ttc" id="class_facility_html_ababbaa909332f3c55699721dc087f0c3"><div class="ttname"><a href="class_facility.html#ababbaa909332f3c55699721dc087f0c3">Facility::getQueueSizeLimit</a></div><div class="ttdeci">unsigned int getQueueSizeLimit() const </div><div class="ttdef"><b>Definition:</b> <a href="_facility_8cpp_source.html#l00952">Facility.cpp:952</a></div></div>
<div class="ttc" id="_link_return_type_8h_html_a554ed4dd9752dfafac386b42493b83afa0bec40bfb1c3fa48c0a7b3b5817508f4"><div class="ttname"><a href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa0bec40bfb1c3fa48c0a7b3b5817508f4">LinkReturnType::LINK_DOWN_PDU_DROPPED</a></div><div class="ttdoc">Link is down. PDU was dropped (or enqueued, depending on the implementation of function Facility::req...</div></div>
<div class="ttc" id="_facility_return_type_8h_html_a4ebe26bb7c3ad3b1926de74522fcc72c"><div class="ttname"><a href="_facility_return_type_8h.html#a4ebe26bb7c3ad3b1926de74522fcc72c">FacilityReturnType</a></div><div class="ttdeci">FacilityReturnType</div><div class="ttdoc">Facility Return Type enum class. </div><div class="ttdef"><b>Definition:</b> <a href="_facility_return_type_8h_source.html#l00028">FacilityReturnType.h:28</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Nov 14 2013 11:18:20 for QCNSim by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
